import groovy.xml.MarkupBuilder
import groovy.util.*

class Example{

    static void main(String[] args){
        def parser = new XmlParser()
        def doc = parser.parse('movies.xml')
        println doc.movie
        doc.movie.each {
            mv -> 
            println("Movie Name:${mv['@title']}")
            println("Movie Type:${mv.type[0].text()}")
            println("Movie Format:${mv.format[0].text()}")
            println("Movie Year:${mv.year[0].text()}")
            println("Movie Rating:${mv.rating[0].text()}")
            println("Movie Stars:${mv.stars[0].text()}")
            println("Movie Description:${mv.description[0].text()}")
            println("**************************************")
        }
    }
}